package top.chengdongqing.mishop.repositories

import org.springframework.data.jpa.repository.JpaRepository
import top.chengdongqing.mishop.entities.Banner
import top.chengdongqing.mishop.enums.BannerType

interface BannerRepository : JpaRepository<Banner, Int> {

    fun findAllByTypeAndEnabledTrueOrderBySortNo(type: BannerType): List<Banner>

    fun findAllByTypeAndEnabledTrueAndAssociatedIdOrderBySortNo(type: BannerType, associatedId: Int): List<Banner>
}